package com.mlnx.device.pojo.dto;

import com.mlnx.bptp.body.DetectState;
import com.mlnx.bptp.body.DetectTime;
import com.mlnx.bptp.body.IsBegin;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * Created by amanda.shan on 2019/3/29.
 * 设置自动检测命令
 */

@AllArgsConstructor
@NoArgsConstructor
public class AutoDetectCmdDto {

    private String deviceId;
    private IsBegin isBegin;//设置昼夜测量状态
    private DetectTime detectTime;//设置昼夜测量时间
    private DetectState detectState;//设置启动/停止测量

    private Integer rectify;// 1为矫正时间

    private String synData;// 1为同步数据

    public String getSynData() {
        return synData;
    }

    public void setSynData(String synData) {
        this.synData = synData;
    }

    public Integer getRectify() {
        return rectify;
    }

    public void setRectify(Integer rectify) {
        this.rectify = rectify;
    }

    public DetectState getDetectState() {
        return detectState;
    }

    public void setDetectState(DetectState detectState) {
        this.detectState = detectState;
    }

    public IsBegin getIsBegin() {
        return isBegin;
    }

    public void setIsBegin(IsBegin isBegin) {
        this.isBegin = isBegin;
    }

    public DetectTime getDetectTime() {
        return detectTime;
    }

    public void setDetectTime(DetectTime detectTime) {
        this.detectTime = detectTime;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }


    public String getKey() {
        if (isBegin != null) {
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    ", isBegin=" + isBegin.toString() +
                    '}';
        } else if (detectState != null) {
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    ", detectState=" + detectState.toString() +
                    '}';
        } else if (detectTime != null) {
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    ", detectTime=" + detectTime.toString() +
                    '}';
        }else if(synData !=null){
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    "synData='" + synData + '\'' +
                    '}';
        } else {
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    "rectify='" + rectify + '\'' +
                    '}';
        }

    }

    @Override
    public String toString() {
        if (isBegin != null) {
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    ", isBegin=" + isBegin.toString() +
                    '}';
        } else if (detectState != null) {
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    ", detectState=" + detectState.toString() +
                    '}';
        } else if (detectTime != null) {
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    ", detectTime=" + detectTime.toString() +
                    '}';
        }else if(synData !=null){
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    "synData='" + synData + '\'' +
                    '}';
        } else {
            return "AutoDetectCmd{" +
                    "deviceId='" + deviceId + '\'' +
                    "rectify='" + rectify + '\'' +
                    '}';
        }
    }

}
